package com.zl.controlle;

import com.zl.pojo.User;
import org.springframework.web.bind.annotation.*;

/**
 * @author zl
 * @date 2023/3/18
 * @apiNote
 */
@RestController
public class UserController {

    @GetMapping("/testGet")
    public String testGet(String name){
        System.out.println(name);
        return "ok";
    }

    /**
     * post的两种传参
     */
    @PostMapping("/testPost1")
    public String testPost1(@RequestBody User user){//传递json字符串
        System.out.println(user);
        return "ok";
    }
    @PostMapping("/testPost2")
    public String testPost2(User user){//接收form表单
        System.out.println(user);
        return "ok";
    }

}
